
$("#J_RegButton").on("click",function(e){
    e.preventDefault();
    let username = $("#J_RegistUser").val();
    let password = $("#J_RegistPsw").val();
    if(username==""||password==""){
        alert("用户名或密码不能为空")
    }else{
        $.get("http://jx.xuzhixiang.top/ap/api/reg.php",{
        username:username,
        password:password,
      }).then((resData)=>{
        if(resData.code==1){
            window.alert("注册成功,点击跳转到登录页面");
            window.location.href="login-regist.html";
        }else{
            alert(resData.msg)
        }
        console.log(resData);
      }); 
    }
    
})